package com.lrs.java.j2se_self.io;

import java.io.*;
public class TestFileReader {
	public static void main(String[] args){
		FileReader fr = null;
		int b = 0;
		try{
			fr = new FileReader("D:/javawork6.0/eclipse Project/eclipse3.3/src/io/TestFileReader.java");
		}catch(FileNotFoundException e){
			e.printStackTrace();
		}
		try{
			long num = 0;
			while((b=fr.read())!=-1){
				System.out.print((char)b);
				num++;
			}
			fr.close();
			System.out.println(num);
		}catch(FileNotFoundException e){
			System.out.println("没找到指定文件!");
			System.exit(-1);
		}catch(IOException ex){
			System.out.println("文件错误!");
			System.exit(-1);
		}
	}
}
